/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.sandiego.test.thread.v01;

import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author X
 */
public class MainThread {

    public static void main(String[] args) {

        Thread threadJob1 = new Thread(new Thread01("Thread 1"));
        Thread threadJob2 = new Thread(new Thread01("Thread 2"));
        Thread threadJob3 = new Thread(new Thread01("Thread 3"));
        Thread threadJob4 = new Thread(new Runnable() {

            private String name = "Boom!";

            public void run() {
                for (int i = 0; i <= 10000; i++) {
                    System.out.println(name + " = " + String.format("%07d", i));
                }
                System.out.println("*************** " + name.toUpperCase() + " DONE! ***************");
            }
        });

        threadJob1.setName("mythread001");
        threadJob2.setName("mythread002");
        threadJob3.setName("mythread003");
        threadJob4.setName("mythread004");

        threadJob1.setPriority(Thread.MAX_PRIORITY);

        threadJob1.start();
        threadJob2.start();
        threadJob3.start();
        threadJob4.start();

        System.out.println(Thread.activeCount());
    }
}
